<template>
  <!-- 导航组件 -->
  <div class="nav-show">
    <div 
      class="div"
      :style="{background: ruleFormLocal.bgColor}"
    >
    </div>
     <option-right v-if="dateFactory.activeBorder">
      <div class="option-wrap">
        <el-form :model="ruleFormLocal"   label-width="100px">
          <div class="edit-componet-title">
            变化
          </div>
          <el-form-item label="背景颜色" prop="bgColor">
            <div class="border-wrap">
              <el-color-picker v-model="ruleFormLocal.bgColor" size="small" ></el-color-picker>
              <el-link type="primary" :underline="false" @click="ruleFormLocal.bgColor == '#f40'">重置</el-link>
            </div>
          </el-form-item>
        </el-form>
      </div>
    </option-right>
  </div>
</template>

<script>
export default {
  name: 'DivChange',
  props: {
    dateFactory: Object,
    index: Number,
    diyData: Array,
  },
  data() {
    return {
      ruleFormLocal:this.dateFactory.ruleForm,
    }
  },
  watch: {
    ruleFormLocal: {
      handler: function (newValue) {
        this.diyData[this.index].ruleForm = newValue
        this.$EventBus.$emit('diyFactory', this.diyDataTwo)
      },
      deep: true,
    }
  },
  computed: {
    
  },
  mounted() {
    
  },
  methods: {

  },
}
</script>

<style lang="less" scoped>
  .div {
    width: 100px;
    height: 100px;
  }
  .option-wrap {
    .el-form  {
      .edit-componet-title {
        margin-bottom: 15px;
        padding-bottom: 7px;
        border-bottom: 1px solid #e5e5e5;
        font-size: 14px;
      }
      .el-form-item {
        .border-wrap {
          display: flex;
          align-items: center;
          .el-color-picker {
            margin-right: 12px;
          }
        }
        .side {
          display: flex;
          align-items: center;
          align-items: center;
          .el-slider {
            flex: 1;
          }
          &> span {
            margin-left: 14px;
          }
        }
      }
    }
  }
  
</style>